#include <sys/syscall.h>
#include <stdint.h>

void sys_sleep(uint32_t time)
{
    invoke_syscall(SYSCALL_SLEEP, time, IGNORE, IGNORE);
}
int sys_getcursor(int id){
    return invoke_syscall(SYSCALL_GETCURSOR, id, IGNORE, IGNORE);
}
void sys_write(char *buff)
{
    invoke_syscall(SYSCALL_WRITE, (uintptr_t)buff, IGNORE, IGNORE);
}

void sys_block(queue_t * queue){
    invoke_syscall(SYSCALL_BLOCK,queue,IGNORE, IGNORE);
}

void sys_unblock(queue_t * queue){
    invoke_syscall(SYSCALL_UNBLOCK,queue,IGNORE, IGNORE);
}
void sys_yield(){
    invoke_syscall(SYSCALL_YIELD,IGNORE,IGNORE, IGNORE);
}

int mutex_lock_release(mutex_lock_t *lock){
    invoke_syscall(SYSCALL_MUTEX_LOCK_RELEASE,lock,IGNORE, IGNORE);
}
int mutex_lock_acquire(mutex_lock_t *lock){
    invoke_syscall(SYSCALL_MUTEX_LOCK_ACQUIRE,lock,IGNORE, IGNORE);
}
int mutex_lock_init(mutex_lock_t *lock){
    invoke_syscall(SYSCALL_MUTEX_LOCK_INIT,lock,IGNORE, IGNORE);
}
void sys_reflush()
{
    invoke_syscall(SYSCALL_REFLUSH, IGNORE, IGNORE, IGNORE);
}

void sys_move_cursor(int x, int y)
{
    invoke_syscall(SYSCALL_CURSOR, x, y, IGNORE);
    return;
}

long sys_get_timebase()
{
    return invoke_syscall(SYSCALL_GET_TIMEBASE, IGNORE, IGNORE, IGNORE);
}

long sys_get_tick()
{
    return invoke_syscall(SYSCALL_GET_TICK, IGNORE, IGNORE, IGNORE);
}

pid_t sys_spawn(task_info_t *info, void* arg, spawn_mode_t mode){
    return invoke_syscall(SYSCALL_SPAWN,info,arg,mode);
}
void sys_exit(void){
    invoke_syscall(SYSCALL_EXIT,IGNORE,IGNORE,IGNORE);
}

int sys_kill(pid_t pid){
    return invoke_syscall(SYSCALL_KILL,pid,IGNORE,IGNORE);
}
int sys_waitpid(pid_t pid){
    return invoke_syscall(SYSCALL_WAITPID,pid,IGNORE,IGNORE);
}
pid_t sys_getpid(){
    return invoke_syscall(SYSCALL_GETPID,IGNORE,IGNORE,IGNORE);
}
int sys_get_char(){
    return invoke_syscall(SYSCALL_GET_CHAR,IGNORE,IGNORE,IGNORE);
}
void sys_ps(){
    invoke_syscall(SYSCALL_PS,IGNORE,IGNORE,IGNORE);
}
void sys_screen_clear(){
    invoke_syscall(SYSCALL_SCREEN_CLEAR,IGNORE,IGNORE,IGNORE);
}
int binsemget(int key){
    return invoke_syscall(SYSCALL_BINSEMGET,key,IGNORE,IGNORE);
}
int binsemop(int binsem_id, int op){
    return invoke_syscall(SYSCALL_BINSEMOP,binsem_id,op,IGNORE);
}
void sys_taskset(int mask,int pid){
    invoke_syscall(SYSCALL_TASKSET,mask,pid,IGNORE);
}